package UDPTransfer;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.net.DatagramPacket;
import java.net.DatagramSocket;

public class UDPServer {

	public static void main(String[] args) throws IOException {
		DatagramSocket datagramsocket = new DatagramSocket(9090);
		byte[] receive = new byte[1024];
		DatagramPacket datagrampacket = new DatagramPacket(receive,receive.length);
		boolean flag = true;
		while(flag)
		{
		datagramsocket.receive(datagrampacket);
		System.out.println(new String(receive,0,datagrampacket.getLength()));

		}

		datagramsocket.close();
		}
}
